package com.xxf.aynu.parking;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

/**
 * Created by Rossoneri on 2017/5/12 0012.
 */
public class waiting_activity extends Activity {
    public static final String INFO_USER_NAME = "INFO_USER_NAME";
    private EditText infoNameText;
    private EditText infoPerSignText;
    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.login_waiting);


        //获取上个Activity中的内容
        //Username
        //Password
        infoNameText=(EditText)findViewById(R.id.login_wt_name);
        infoPerSignText=(EditText)findViewById(R.id.login_wt_password);
        Intent intent = this.getIntent();
        String Username=intent.getStringExtra(newlogin.INFO_USER_NAME);
        String Password=intent.getStringExtra(newlogin.INFO_PER_SIGN);
        infoNameText.setText(Username);
        infoPerSignText.setText(Password);
        //延迟两秒finish()
/*
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Toast.makeText(waiting_activity.this, "欢迎回来", Toast.LENGTH_SHORT).show();
            }
        },2000);

*/
         Handler x= new Handler();
        x.postDelayed(new splashhandler(),2000 );
    }
    class splashhandler implements Runnable{
        public  void run()
        {
            EditText tx_uid=(EditText)findViewById(R.id.login_wt_name);
            String Uid=tx_uid.getText().toString();

            Toast.makeText(waiting_activity.this, "欢迎回来", Toast.LENGTH_SHORT).show();
            Intent intent=new Intent();
            intent.putExtra(INFO_USER_NAME,Uid);
            intent.setClass(getApplication(), activity_mine_unlog.class);
            startActivity(intent);
           // startActivity(new Intent(getApplication(),activity_mine.class));
            waiting_activity.this.finish();
        }
    }
}
